package router

import (
	"go_final/mxshop_api/goods_web/api/brand"
	middlewares "go_final/mxshop_api/goods_web/middleware"

	"github.com/gin-gonic/gin"
)

func InitBrandRouter(Router *gin.RouterGroup) {
	GoodsRouter := Router.Group("brands")
	{
		GoodsRouter.GET("", brand.List)
		GoodsRouter.POST("", middlewares.JWTAuth(), middlewares.IsAdmin(), brand.Create)
		GoodsRouter.DELETE("/:id", middlewares.JWTAuth(), middlewares.IsAdmin(), brand.Delete)
		GoodsRouter.PUT("/:id", middlewares.JWTAuth(), middlewares.IsAdmin(), brand.Update)
	}

	CategoryBrandRouter := Router.Group("categorybrands")
	{
		CategoryBrandRouter.GET("", brand.CategoryBrandList)          // 类别品牌列表页
		CategoryBrandRouter.DELETE("/:id", brand.DeleteCategoryBrand) // 删除类别品牌
		CategoryBrandRouter.POST("", brand.NewCategoryBrand)          //新建类别品牌
		CategoryBrandRouter.PUT("/:id", brand.UpdateCategoryBrand)    //修改类别品牌
		CategoryBrandRouter.GET("/:id", brand.GetCategoryBrandList)   //获取分类的品牌
	}
}
